import { Route, Router, Switch } from './pages/router-write/mini-router'
import A from './pages/router-write/views/A'
import B from './pages/router-write/views/B'
import C from './pages/router-write/views/C'

export default function App() {
  return (
    <Router>
      <Switch>
        <Route component={A} pathname="/a" />
        <Route component={B} pathname="/b" />
        <Route
          pathname="/context"
          render={(props) => {
            return <div>context</div>
          }}
        />
        {/* 如果什么都匹配不到 就用最后的 */}
        <Route
          pathname="*"
          render={(props) => {
            return <div>找不到你的路由元素 亲！</div>
          }}
        />
      </Switch>
    </Router>
  )
}
